<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tr09" uri="http://www.51i-star.com/mypagetagsdetailedcommoditycommodity" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查看商品详情</title>
<style type="text/css">
	body{
		background:#dae4fe;
	}
	.t{
		border-collapse: collapse;
		border: none;
		width: 760px;
		font-size:14px;
	}
	.t td{
		text-align: center;
	}
	.border_bottom_empty{
		background:#CCC;
	}
	.c{
		background:#CCC;
	}
	tr:hover{
		cursor:pointer;
	}
	h2,table,.pager{
		margin-left:20px;
	}
	.one1{
		font-size:14px;
		font-weight:bold;
		margin:5px;
	}
</style>
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<script type="text/javascript">
	$(function(){
		$(".delete").click(function(){
			var cid = $(this).attr("cid");
			var curpage = $(this).attr("curpage");
			$.get("deletecommodity",{cid:cid,curpage:curpage},function(v){
				location.reload();
				alert(v);
			});
		});
		$(".shangjia").click(function(){
			var cid = $(this).attr("cid");
			alert(cid);
			$.get("commodityshangjia",{cid:cid},function(v){
				location.reload();
				alert(v);
			});
		});
		$(".shangjia1").click(function(){
			var cid = $(this).attr("cid");
			$.get("commodityshangjia",{cid:cid},function(v){
				location.reload();
				alert(v);
			});
		});
		$("tr:even").css("background","#ccffcc");
		$("tr:odd").css("background","#ccffff");
		$("table tr").mouseenter(function(){
			$(this).css("background","#CCC");
		}).mouseleave(function(){
			$("tr:even").css("background","#ccffcc");
			$("tr:odd").css("background","#ccffff");
		});
		
	});
</script>
<link rel=stylesheet type=text/css href="css/input.css">
</head>
<body>
	<div class="one1">
		商品管理->查询商品详情
		<hr>
	</div>
	<h2>商品详细信息</h2>
	<form action="selectcommodity2zhongzhuan?curpage=1&pagesize=10" method="post">
		<select name="dState">
			<option value="0">按上下架状态</option>
			<option value="未上架">未上架</option>
			<option value="已上架">已上架</option>
			<option value="已下架">已下架</option>
		</select>
		<input type="text" name="mohu" onkeyup="this.value=this.value.replace(/[^A-Za-z\u4e00-\u9fa5]/g,'')">
		<input type="submit" value="查   询">
	</form>
	<table id="t" border="1" class="t">
		<tr class ="border_bottom_empty">
			<th>商品名称</th>
			<th>商品进价</th>
			<th>商品售价</th>
			<th>商品库存</th>
			<th>商品销量</th>
			<th>商品重量</th>
			<th>商品属性</th>
			<th>上下架状态</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${list}" var="com">
			<tr>
				<td width="10%">${com.cName}</td>
				<td width="10%">${com.dPprice}</td>
				<td width="10%">${com.dPrice}</td>
				<td width="10%">${com.dStock}</td>
				<td width="10%">${com.dSales}</td>
				<td width="10%">${com.dDescribe}</td>
				<td width="10%">${com.caName}</td>
				<td width="10%">${com.dState}</td>
				<td width="20%">
					<c:if test="${com.dState eq '已上架'}">
						<a href="selectxiajia?cid=${com.cId}"><img title="下架" src="images/tubiao3/下架.png"></a>
					</c:if>
					<c:if test="${com.dState eq '已下架'}">
						<a href="selectshangjia?cid=${com.cId}"><img title="上架" src="images/tubiao3/上架.png"></a>
					</c:if>
					<c:if test="${com.dState eq '未上架'}">
						<a href="selectshangjia?cid=${com.cId}"><img title="上架" src="images/tubiao3/上架.png"></a>
					</c:if>
					<a href="selectaddcommodity"><img title="添加商品" src="images/tubiao3/添加 (1).png"></a>
					<a href="selectcommodityupdate?cid=${com.cId}"><img title="修改商品" src="images/tubiao3/修改 (1).png"></a>
					<a class="delete" cid="${com.cId}" curpage="${param.curpage}" href="javascript:void(1)"><img title="删除商品" src="images/tubiao3/删除 (1).png"></a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<div class="pager">
		<tr09:pager mohu="" url="selectcommodity2" pagesize="10" total="${total}" dState="" curpage="${param.curpage}"/>
	</div>
</body>
</html>